﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Commerce.Base.Ubl.DataType
{
    /// <summary>
    /// One calendar day according the Gregorian calendar.
    /// </summary>
    public class Date : DateTime
    {
        public Date(System.DateTime value)
            : base(value)
        { }

        public override string ToString()
        {
            return this.Value.ToString("yyyy-MM-dd");
        }

        public static implicit operator Date(System.DateTime value)
        {
            return new Date(value);
        }

        public static implicit operator System.DateTime(Date date)
        {
            return date.Value;
        }
    }
}
